/*
 * @Description: app state
 * @Author: chenju
 * @Date: 2021-06-01 11:10:14
 * @LastEditors: chenju
 * @LastEditTime: 2023-01-09 14:40:58
 */

export interface AppState {
  spinning: boolean;
  keepAliveRoutes: string[];
  dataRequestCount: number;
  businessOppoCount: number;
  opinionCount: number;
  // 因子审核总数
  auditCount: number;
  // 消息未读数 总数
  messageUnreadCount: number;
  // 消息未读数 通知消息数
  messageUnreadCountSys: number;
  // 消息未读数 预警消息数
  messageUnreadCountWarning: number;
  // 侧边栏折叠状态
  collapsed: boolean;
  language: 'zh' | 'en';
  // 任务名称
  tempTaskName: string;
  // 标记是否删除keepAlive
  removeAliveFlag: boolean;
  // 阶段错误标识
  stageError: Array<any>;
  // 用于面包屑跳转
  tempDataStaticBreadcrumbName: string[];
  // 全局配置项
  globalConfig: {
    isShowChartLine: boolean;
  };
  // 是否是供应商端
  isSupplier: boolean;
}

export const state: AppState = {
  spinning: false,
  keepAliveRoutes: [],
  dataRequestCount: 0,
  businessOppoCount: 0,
  opinionCount: 0,
  // 因子审核总数
  auditCount: 0,
  messageUnreadCount: 0,
  messageUnreadCountSys: 0,
  messageUnreadCountWarning: 0,
  collapsed: false,
  language: 'zh',
  tempTaskName: '',
  removeAliveFlag: false,
  stageError: [],
  tempDataStaticBreadcrumbName: [],
  globalConfig: {
    isShowChartLine: window.HIDE_ECI_CHART_LINE ? false : true
  },
  isSupplier: false
};
